<template>
  <div class="doctor-item">
    <nuxt-link :to="`/doctor/${doctorData.user_id}`">
      <div
        class="doctor-item-photo"
        :style="{background:'url('+doctorData.user_photo+') center center no-repeat',backgroundSize:'100% 100%'}"
      >
        <div class="doctor-item-photo-icon" />
      </div>
    </nuxt-link>

    <div class="doctor-item-content">
      <div class="doctor-item-content-wrap">
        <nuxt-link :to="`/doctor/${doctorData.user_id}`">
          <div
            class="doctor-item-content-left"
          >
            <div class="doctor-item-user-name">
              <div class="doctor-item-user-name-text">
                {{ doctorData.user_name }}
              </div>
              <div class="doctor-item-user-position">
                {{ doctorData.user_attributes.doctor_title }} | 从业{{ disYears(doctorData.user_attributes.working_seniority) }}年
              </div>
            </div>
            <div class="doctor-item-hospital">
              医院:{{ doctorData.user_attributes.hospital_name }}
            </div>
            <div
              v-if="doctorData.user_attributes.statistic!=null&&doctorData.user_attributes.statistic.length"
              class="doctor-item-good-at"
            >
              <div class="doctor-item-good-at-text">
                擅长：
              </div>
              <div
                v-for="item in doctorData.user_attributes.statistic"
                :key="item.id"
                class="doctor-item-statistic-item"
              >
                {{ item.name }} <span>{{ item.case_count }} </span>例
              </div>
            </div>
          </div>
        </nuxt-link>
        <div class="doctor-item-content-right">
          <nuxt-link :to="`/doctor/${doctorData.user_id}`">
            <div class="doctor-item-content-right-details">
              <div class="doctor-item-content-right-details-icon" />
              <div class="doctor-item-content-right-details-text">
                查看详情
              </div>
            </div>
          </nuxt-link>
          <nuxt-link to="/aboutus" rel="nofollow">
            <div class="doctor-item-content-right-consultation">
              <div class="doctor-item-content-right-consultation-icon" />
              <div class="doctor-item-content-right-consultation-text">
                免费咨询
              </div>
            </div>
          </nuxt-link>
        </div>
      </div>
      <div class="doctor-item-content-product">
        <div
          v-if="doctorData.doctor_service.list.length>=1"
        >
          <nuxt-link :to="`/product/${doctorData.doctor_service.list[0].product_id}`" class="doctor-item-content-product-one">
            <div class="doctor-item-content-product-one-name-wrap">
              <div class="doctor-item-content-product-one-icon" />
              <div class="doctor-item-content-product-one-product_name">
                {{ doctorData.doctor_service.list[0].product_name }}
              </div>
            </div>
            <div class="doctor-item-content-product-one-price">
              ￥{{ doctorData.doctor_service.list[0].package.sale.selling_price }}
            </div>
          </nuxt-link>
        </div>
        <div
          v-if="doctorData.doctor_service.list.length>=2"
        >
          <nuxt-link :to="`/product/${doctorData.doctor_service.list[1].product_id}`" class="doctor-item-content-product-two">
            <div class="doctor-item-content-product-two-name-wrap">
              <div class="doctor-item-content-product-two-icon" />
              <div class="doctor-item-content-product-two-product_name">
                {{ doctorData.doctor_service.list[1].product_name }}
              </div>
            </div>
            <div class="doctor-item-content-product-two-price">
              ￥{{ doctorData.doctor_service.list[1].package.sale.selling_price }}
            </div>
          </nuxt-link>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import { disYears } from '@/utils/util'
export default {
  components: {

  },
  props: {
    doctorData: {
      type: Object,
      default: () => { }
    }
  },
  data() {
    return {
      disYears
    }
  },
  computed: {

  },
  created() {
  },
  mounted() {

  },
  methods: {
    jumpProductDetails(i) {
      this.$router.push(`/product/${i}`)
    }
  }
}
</script>
<style scoped lang="scss">
.doctor-item:hover{
  box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.1);
}
.doctor-item {
  width: 840px;
  background: rgba(255, 255, 255, 1);
  overflow: hidden;
  display: flex;
  margin-top: 10px;
}
.doctor-item-photo {
  width: 80px;
  height: 80px;
  border-radius: 4px;
  margin-top: 8px;
  margin-left: 8px;
  border: 1px solid rgba(237, 237, 237, 1);
  position: relative;
  .doctor-item-photo-icon {
    width: 20px;
    height: 20px;
    background: url("~assets/img/authentication.png") center center no-repeat;
    background-size: 100% 100%;
    position: absolute;
    right: 0;
    bottom: 0;
  }
}
.doctor-item-photo:hover {
  cursor: pointer;
}
.doctor-item-content {
  width: 752px;
}
.doctor-item-content-wrap {
  height: 80px;
  margin-left: 8px;
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
}
.doctor-item-content-left:hover {
  cursor: pointer;
}
.doctor-item-user-name {
  display: flex;
  align-items: center;
}
.doctor-item-user-name-text {
  font-size: 16px;
  font-weight: 600;
  color: rgba(51, 51, 51, 1);
  line-height: 22px;
}
.doctor-item-user-position {
  font-size: 12px;
  font-weight: 400;
  color: rgba(153, 153, 153, 1);
  line-height: 17px;
  margin-left: 10px;
}
.doctor-item-hospital {
  font-size: 12px;
  font-weight: 400;
  color: rgba(153, 153, 153, 1);
  line-height: 17px;
  margin-top: 6px;
}
.doctor-item-good-at {
  display: flex;
  margin-top: 17px;
  flex-wrap: wrap;
}
.doctor-item-good-at-text {
  font-size: 12px;
  font-weight: 400;
  color: rgba(153, 153, 153, 1);
  line-height: 17px;
}
.doctor-item-statistic-item {
  padding: 1px 9px;
  background: rgba(245, 245, 245, 1);
  border-radius: 10px;
  font-size: 12px;
  font-weight: 400;
  color: rgba(102, 102, 102, 1);
  line-height: 17px;
  margin-right: 10px;
  > span {
    color: #333;
  }
}
.doctor-item-content-product {
  margin-top: 9px;
  padding-right: 22px;
}
.doctor-item-content-right {
  display: flex;
  margin-right: 22px;
  .doctor-item-content-right-details:hover{
    cursor: pointer;
    background: rgba(246, 246, 246, 1);
  }
  .doctor-item-content-right-details {
    width: 59px;
    height: 59px;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-right: 25px;
    .doctor-item-content-right-details-icon {
      width: 23px;
      height: 23px;
      background: url("~assets/img/query-icon.png") center center no-repeat;
      background-size: 100% 100%;
      margin: 0 auto;
    }
    .doctor-item-content-right-details-icon:hover {
      cursor: pointer;
    }
    .doctor-item-content-right-details-text {
      font-size: 12px;

      font-weight: 400;
      color: rgba(153, 153, 153, 1);
      line-height: 17px;
    }
    .doctor-item-content-right-details-text:hover {
      cursor: pointer;
    }
  }
  .doctor-item-content-right-consultation:hover {
    cursor: pointer;
    background: rgba(246, 246, 246, 1);
  }
  .doctor-item-content-right-consultation {
    width: 59px;
    height: 59px;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    .doctor-item-content-right-consultation-icon {
      width: 23px;
      height: 23px;
      background: url("~assets/img/consultation-icon.png") center center
        no-repeat;
      background-size: 100% 100%;
      margin: 0 auto;
    }
    .doctor-item-content-right-consultation-icon:hover {
      cursor: pointer;
    }
    .doctor-item-content-right-consultation-text {
      font-size: 12px;

      font-weight: 400;
      color: rgba(153, 153, 153, 1);
      line-height: 17px;
    }
    .doctor-item-content-right-consultation-text:hover {
      cursor: pointer;
    }
  }
}
.doctor-item-content-product-one {
  width: 100%;
  height: 50px;
  border-top: 1px solid rgba(240, 240, 240, 1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  .doctor-item-content-product-one-icon {
    width: 18px;
    height: 18px;
    background: url("~assets/img/buy.png") center center no-repeat;
    background-size: 100% 100%;
  }
  .doctor-item-content-product-one-product_name {
    width: 600px;
    font-size: 14px;
    font-weight: 400;
    color: rgba(51, 51, 51, 1);
    line-height: 20px;
    text-overflow: -o-ellipsis-lastline;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
  }
  .doctor-item-content-product-one-price {
    font-size: 14px;

    font-weight: 400;
    color: rgba(255, 0, 69, 1);
    line-height: 20px;
  }
}
.doctor-item-content-product-one:hover {
  cursor: pointer;
}
.doctor-item-content-product-two {
  width: 100%;
  height: 50px;
  border-top: 1px solid rgba(240, 240, 240, 1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  .doctor-item-content-product-two-icon {
    width: 18px;
    height: 18px;
    background: url("~assets/img/buy.png") center center no-repeat;
    background-size: 100% 100%;
  }
  .doctor-item-content-product-two-product_name {
    width: 600px;
    font-size: 14px;
    font-weight: 400;
    color: rgba(51, 51, 51, 1);
    line-height: 20px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .doctor-item-content-product-two-price {
    font-size: 14px;

    font-weight: 400;
    color: rgba(255, 0, 69, 1);
    line-height: 20px;
  }
}
.doctor-item-content-product-two:hover {
  cursor: pointer;
}
.doctor-item-content-product-one-name-wrap{
  display: flex;
}
.doctor-item-content-product-two-name-wrap{
  display: flex;
}
</style>
